import Vue from 'vue'
import Router from 'vue-router'


Vue.use(Router);

const routes = [
    {
        path: '/',
        name: 'index',
        meta: {
            title: '首页',
            showNav: 'index',
        },
        component: () => import('@v/index/index'),
        children: []
    }

];


const router = new Router({
    routes,
    // base: process.env.URL,
    base: '/epcd_visual',
    mode: 'history',
    // mode: 'hash'
});



router.beforeEach((to, from, next) => {
    next();
});

router.afterEach((to, from, next) => {

});

// 防止报错： Uncaught (in promise) NavigationDuplicated {_name: "NavigationDuplicated", name: "NavigationDuplicated"}
const originalPush = Router.prototype.push;
Router.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err)
};

export default router;

